package com.dev;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.drawable.StateListDrawable;
import android.graphics.drawable.ColorDrawable;
import android.app.Application;
public class IconViewClose extends IconView{
	int borderColor=0xff928337;
	public IconViewClose(MainActivity ma){
		super(ma);
		StateListDrawable sld=new StateListDrawable();
		sld.addState(new int[]{android.R.attr.state_pressed},new ColorDrawable(0xff555555));
		setBackground(sld);
	}
	public IconViewClose(MainActivity ma,int color){
		this(ma);
		borderColor=color;
	}
	@Override
	public void onDraw(Canvas cvs){
		Paint p=new Paint();
		p.setStrokeWidth(getHeight()*1/9);
		p.setColor(borderColor);
		Rect region=new Rect();
		int padding=getHeight()/4;
		region.top=padding;
		region.bottom=getHeight()-padding;
		region.left=(getWidth()-region.height())/2;
		region.right=region.left+region.height();
		cvs.drawLine(region.left,region.top,region.right,region.bottom,p);
		cvs.drawLine(region.left,region.bottom,region.right,region.top,p);
	}
}
